package cn.e2win.biz.dbo;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.springframework.web.multipart.MultipartFile;

import cn.e2win.base.entity.BaseApproveI;
import cn.e2win.base.entity.BaseEntity;
import cn.e2win.base.entity.SysAttach;

@Entity
@Table(name = "activity")
public class Activity extends BaseEntity implements BaseApproveI{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

		//编号--结算单
		@Id
		@Basic(optional = false)
		@GeneratedValue(strategy = GenerationType.IDENTITY)
		@Column(name = "id", nullable = false)
		private Integer id;
		

		public Notice getApproveNotice(){
			Notice notice = new Notice(this);
			String msg = "";
			//提交审核时，发消息给adminUserId
			if("SUBMITED".equals(this.getApproveStatus())){
				notice.setToUserId(this.getAdminUserId());
				msg = "活动 【" + this.getActivityName() + "】 已提交审核，需要您的审核，请知晓！" ;
			}else if("APPROVED".equals(this.getApproveStatus()) || "REJECTED".equals(this.getApproveStatus())) {
				
				notice.setToUserId(this.getCreateById());
				if("APPROVED".equals(this.getApproveStatus())){
					msg = "活动 【" + this.getActivityName() + "】 已被审核通过，请知晓！";  
				}else if("REJECTED".equals(this.getApproveStatus())){
					msg = "活动 【" + this.getActivityName() + "】 已被审核驳回，请知晓！";
					
				}
				
			}
			notice.setNoticeType("APPROVE");
			notice.setNoticeDesc(msg);
			return notice;
		}

		public Activity() {
			super();
		}

		public Activity(Integer id) {
			this.id = id;
		}
		private Integer adminUserId;//专管员ID
		private Integer adminUserId2;//专管员2ID

		private String activityName;//活动名称
		private Timestamp beginTime;
		private Timestamp endTime;
		private String areaId;//地址	 经纬度位标
		private String address;//地址	 经纬度位标
		private BigDecimal x;
		private BigDecimal y;
		

		private String contact;
		private String tel;
		private String email;
		private String qrCode;//二唯码

		private Integer planCnt;//计划参与人数
		private Integer registedCnt;//已报名人数
		private Integer checkinCnt;//已签到人数
		
		@Transient
		private String activityTag;//活动标签	
		private String activityType;//活动类型
		@Transient
		private MultipartFile[] posterFile;//海报
		@Transient
		private List<SysAttach> posterList;//海报
		
		
		private String isOpen;//是否公开	

		private String activityDy;//导语
		private String activityDesc;//说明
		private String attendObj;//参加对象

		private Integer orgId;//承办方(创业之家)
		private String dwName;//承办方名称 冗余 
		private String sponsorName;//主办方
		private String sponsorDesc;//主办方相关说明
		private String zbdw;//主办单位
		private String xbdw;//协办单位
		private String zddw;//指导单位
		private String mtzc;//媒体支持
		

		

		private String mainPicUrl;//主图片
		@Transient
		private MultipartFile mainPic;
		
		

		private String approveStatus="UNSUBMIT";//审核状态 默认为未提交
		@Transient
		private String approveDesc;//审核说明
		public Integer getId() {
			return id;
		}
		public void setId(Integer id) {
			this.id = id;
		}
		public String getActivityName() {
			return activityName;
		}
		public void setActivityName(String activityName) {
			this.activityName = activityName;
		}
		
		public Timestamp getBeginTime() {
			return beginTime;
		}

		public void setBeginTime(Timestamp beginTime) {
			this.beginTime = beginTime;
		}

		public Timestamp getEndTime() {
			return endTime;
		}

		public void setEndTime(Timestamp endTime) {
			this.endTime = endTime;
		}

		public String getAreaId() {
			return areaId;
		}
		public void setAreaId(String areaId) {
			this.areaId = areaId;
		}
		public String getAddress() {
			return address;
		}
		public void setAddress(String address) {
			this.address = address;
		}
		public BigDecimal getX() {
			return x;
		}
		public void setX(BigDecimal x) {
			this.x = x;
		}
		public BigDecimal getY() {
			return y;
		}
		public void setY(BigDecimal y) {
			this.y = y;
		}
		public String getContact() {
			return contact;
		}
		public void setContact(String contact) {
			this.contact = contact;
		}
		public String getTel() {
			return tel;
		}
		public void setTel(String tel) {
			this.tel = tel;
		}
		public String getEmail() {
			return email;
		}
		public void setEmail(String email) {
			this.email = email;
		}
		public String getQrCode() {
			return qrCode;
		}
		public void setQrCode(String qrCode) {
			this.qrCode = qrCode;
		}
		public Integer getPlanCnt() {
			return planCnt;
		}
		public void setPlanCnt(Integer planCnt) {
			this.planCnt = planCnt;
		}
		public Integer getRegistedCnt() {
			return registedCnt;
		}
		public void setRegistedCnt(Integer registedCnt) {
			this.registedCnt = registedCnt;
		}
		public Integer getCheckinCnt() {
			return checkinCnt;
		}
		public void setCheckinCnt(Integer checkinCnt) {
			this.checkinCnt = checkinCnt;
		}
		public String getActivityTag() {
			return activityTag;
		}
		public void setActivityTag(String activityTag) {
			this.activityTag = activityTag;
		}
		public String getActivityType() {
			return activityType;
		}
		public void setActivityType(String activityType) {
			this.activityType = activityType;
		}
		public MultipartFile[] getPosterFile() {
			return posterFile;
		}
		public void setPosterFile(MultipartFile[] posterFile) {
			this.posterFile = posterFile;
		}
		public List<SysAttach> getPosterList() {
			return posterList;
		}
		public void setPosterList(List<SysAttach> posterList) {
			this.posterList = posterList;
		}
		public String getIsOpen() {
			return isOpen;
		}
		public void setIsOpen(String isOpen) {
			this.isOpen = isOpen;
		}
		public String getActivityDy() {
			return activityDy;
		}
		public void setActivityDy(String activityDy) {
			this.activityDy = activityDy;
		}
		public String getActivityDesc() {
			return activityDesc;
		}
		public void setActivityDesc(String activityDesc) {
			this.activityDesc = activityDesc;
		}
		public String getAttendObj() {
			return attendObj;
		}

		public void setAttendObj(String attendObj) {
			this.attendObj = attendObj;
		}

		public Integer getOrgId() {
			return orgId;
		}
		public void setOrgId(Integer orgId) {
			this.orgId = orgId;
		}
		public String getSponsorName() {
			return sponsorName;
		}
		public void setSponsorName(String sponsorName) {
			this.sponsorName = sponsorName;
		}
		public String getSponsorDesc() {
			return sponsorDesc;
		}
		public void setSponsorDesc(String sponsorDesc) {
			this.sponsorDesc = sponsorDesc;
		}
		public String getMainPicUrl() {
			return mainPicUrl;
		}
		public void setMainPicUrl(String mainPicUrl) {
			this.mainPicUrl = mainPicUrl;
		}
		public MultipartFile getMainPic() {
			return mainPic;
		}
		public void setMainPic(MultipartFile mainPic) {
			this.mainPic = mainPic;
		}
		
		
		public String getZbdw() {
			return zbdw;
		}
		public void setZbdw(String zbdw) {
			this.zbdw = zbdw;
		}
		public String getXbdw() {
			return xbdw;
		}
		public void setXbdw(String xbdw) {
			this.xbdw = xbdw;
		}
		public String getZddw() {
			return zddw;
		}
		public void setZddw(String zddw) {
			this.zddw = zddw;
		}
		public String getMtzc() {
			return mtzc;
		}
		public void setMtzc(String mtzc) {
			this.mtzc = mtzc;
		}
		public String getApproveStatus() {
			return approveStatus;
		}
		public void setApproveStatus(String approveStatus) {
			this.approveStatus = approveStatus;
		}
		public String getApproveDesc() {
			return approveDesc;
		}
		public void setApproveDesc(String approveDesc) {
			this.approveDesc = approveDesc;
		}
		@Override
		public String getEntityNo() {
			return activityName;
		}

		public Integer getAdminUserId() {
			return adminUserId;
		}

		public void setAdminUserId(Integer adminUserId) {
			this.adminUserId = adminUserId;
		}
		public Integer getAdminUserId2() {
			return adminUserId2;
		}
		public void setAdminUserId2(Integer adminUserId2) {
			this.adminUserId2 = adminUserId2;
		}

		public String getDwName() {
			return dwName;
		}

		public void setDwName(String dwName) {
			this.dwName = dwName;
		}

		
}
